﻿<Window x:Class="Refugees.Views.Windows.NewsEdit"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Refugees.Views.Windows"
        mc:Ignorable="d"
        Title="Новости" Height="450" Width="800">
    <Grid>
        
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF819B3D" Offset="0.061"/>
                <GradientStop Color="#FF4A6A68" Offset="0.217"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="0.1*"/>
            <RowDefinition Height="0.2*"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Ellipse HorizontalAlignment="Center" VerticalAlignment="Top" 
                 Margin="0, 20, 0, 0"
                 Width="100" Height="50" Grid.RowSpan="2">
            <Ellipse.Fill>
                <ImageBrush Stretch="UniformToFill" ImageSource="/Icon/сердцепомощи.jpg"/>
            </Ellipse.Fill>
        </Ellipse>

        <Label Content="Kind Hend" 
               Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom"
                   Foreground="Black"
                   FontSize="36" FontStyle="Italic" 
                   FontWeight="Bold" FontFamily="Perpetua Titling MT"/>
        <Button Content="Назад" Click="BackClick" HorizontalAlignment="Right" Grid.RowSpan="2" VerticalAlignment="Center" Margin="15" Style="{DynamicResource Vhod}"/>

        <Grid Grid.Row="2">
            <ScrollViewer HorizontalScrollBarVisibility="Hidden" HorizontalAlignment="Stretch">
                <StackPanel HorizontalAlignment="Stretch">
                    <GroupBox Header="Заголовок">
                        <TextBox Style="{DynamicResource Login}" TextWrapping="Wrap"  FontSize="20" FontWeight="Bold" Text="{Binding TitleNews}"/>
                    </GroupBox>
                    <GroupBox Header="Текст новости">
                        <TextBox Style="{DynamicResource Login}"
                                 TextWrapping="Wrap" AcceptsReturn="True"
                                 MinHeight="120"
                                 FontSize="20" FontWeight="Bold" Text="{Binding DescriptionNews}"/>
                    </GroupBox>
                    <Image  Width="150" Margin="15"  Name="Image">
                        <Image.Source>
                            <Binding Path="ImageNews" >
                                <Binding.TargetNullValue>
                                    <ImageSource>/Icon/сердцепомощи.jpg</ImageSource>
                                </Binding.TargetNullValue>
                            </Binding>
                        </Image.Source>
                    </Image>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Button Style="{DynamicResource Vhod}" Grid.Column="1" Click="NewImage" Content="Новая картинка"/>
                        <Button Style="{DynamicResource Vhod}" Click="SaveClick" Content="Сохранить"/>
                    </Grid>
                   
                </StackPanel>
            </ScrollViewer>
           
        </Grid>
    </Grid>
</Window>
